package com.jiazhong.basic.pack0724;

import lombok.SneakyThrows;

import java.io.*;

public class DemoG {
    @SneakyThrows
    public static void main(String[] args) {
        File file = new File("/Users/dailyblue/workspace/io/1.txt");
        InputStream in = new FileInputStream(file);
        // 通过InputStreamReader将字节流---->字符流
        Reader reader = new InputStreamReader(in);
        BufferedReader bufferedReader = new BufferedReader(reader);
        String line = bufferedReader.readLine();
        System.out.println(line);
        bufferedReader.close();
        reader.close();
        in.close();

        OutputStream out = new FileOutputStream(file);
        // 通过OutputStreamWriter将字节流---->字符流
        Writer writer = new OutputStreamWriter(out);
        writer.write("asjkdhkdsjhiwheswegqwiud你啊后啊我😋3 的说法 ");
        writer.flush();
    }
}
